﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace Sparrow.Extensions
{
    public static class XElementEx
    {
        public static string attr(this XElement element, string name)
        {
            var attr = element.Attribute(name);

            return attr.GetValue();
        }

        public static string val(this XElement element)
        {
            if (element == null)
            {
                return string.Empty;
            }
            else
            {
                return element.Value;
            }
        }
    }
}
